<!--
 * Copyright (c) 2012 The Chromium Authors. All rights reserved.  Use of this
 * source code is governed by a BSD-style license that can be found in the
 * LICENSE file.
-->
<script src="../common/common.js"></script>
<div style="display:none" id="pageToScriptTunnel"></div>
<div style="display:none" id="scriptToPageTunnel"></div>
<script>

window.onload = function() {
  setupScriptTunnel();
  var backgroundWindow = window.open('bg.html', 'bg', 'background');
  if (backgroundWindow) {
    notifyBackgroundWindowNotNull();
  }
}

function notifyBackgroundWindowNotNull() {
  pageToScriptTunnel.innerText = JSON.stringify(messageData(arguments));
  pageToScriptTunnel.dispatchEvent(scriptMessageEvent);
}
</script>
